﻿using System.Reflection;
using LoungeRepo.Contracts.Core;

namespace LoungeRepo.Normalizer
{
    static class ReflectionExtensions
    {
        public static FieldInfo[] AllFieldsOfObjectType(this object source)
        {
            return source.GetType().GetFields(BindingFlags.Instance |
                                              BindingFlags.NonPublic |
                                              BindingFlags.Public);
        }
    }


    static class NormalizedEntityExtensions
    {
        public static string BuildRefId(this ILoungeRepoEntityIdentity entity)
        {
            return entity.Partition + "/" + entity.Id;
        }
    }
}
